<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>geometry.ShapeWriter</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >MetaGETA (Metadata Gathering, Extraction and Transformation)</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="geometry-module.html">Module&nbsp;geometry</a> ::
        Class&nbsp;ShapeWriter
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="geometry.ShapeWriter-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ShapeWriter</h1><p class="nomargin-top"><span class="codelink"><a href="geometry-pysrc.html#ShapeWriter">source&nbsp;code</a></span></p>
<p>A class for writing geometry and fields to ESRI shapefile format</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="geometry.ShapeWriter-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">shapefile</span>,
        <span class="summary-sig-arg">fields</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
        <span class="summary-sig-arg">srs_wkt</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">update</span>=<span class="summary-sig-default">False</span>)</span><br />
      Open the shapefile for writing or appending.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__del__"></a><span class="summary-sig-name">__del__</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Shutdown and release the lock on the shapefile</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__del__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__error__"></a><span class="summary-sig-name">__error__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">err</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__error__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__createshapefile__"></a><span class="summary-sig-name">__createshapefile__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">shapefile</span>,
        <span class="summary-sig-arg">fields</span>,
        <span class="summary-sig-arg">srs_wkt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Open the shapefile for writing</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__createshapefile__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__openshapefile__"></a><span class="summary-sig-name">__openshapefile__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">shapefile</span>,
        <span class="summary-sig-arg">fields</span>)</span><br />
      Open the shapefile for updating/appending</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__openshapefile__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="geometry.ShapeWriter-class.html#WriteRecord" class="summary-sig-name">WriteRecord</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">extent</span>,
        <span class="summary-sig-arg">attributes</span>)</span><br />
      Write record</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.WriteRecord">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="geometry.ShapeWriter-class.html#UpdateRecord" class="summary-sig-name">UpdateRecord</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">extent</span>,
        <span class="summary-sig-arg">attributes</span>,
        <span class="summary-sig-arg">where_clause</span>)</span><br />
      Update record/s</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.UpdateRecord">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="geometry.ShapeWriter-class.html#DeleteRecord" class="summary-sig-name">DeleteRecord</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">where_clause</span>)</span><br />
      Delete record/s</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.DeleteRecord">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">shapefile</span>,
        <span class="sig-arg">fields</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
        <span class="sig-arg">srs_wkt</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">update</span>=<span class="sig-default">False</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Open the shapefile for writing or appending.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>shapefile</code></strong> (<code>gdal.Dataset</code>) - Dataset object</li>
        <li><strong class="pname"><code>fields</code></strong> (<code>dict</code>) - <a href="formats-module.html#fields" class="link">Fields dict</a></li>
        <li><strong class="pname"><code>srs_wkt</code></strong> (<code>str</code>) - Spatial reference system WKT</li>
        <li><strong class="pname"><code>update</code></strong> (<code>boolean</code>) - Update or overwrite existing shapefile</li>
    </ul></dd>
  </dl>
<div class="fields">      <p><strong>Note:</strong>
        Field names can only be &lt;= 10 characters long. Longer names will
        be silently truncated. This may result in non-unique column names, 
        which will definitely cause problems later. Field names can not 
        contain spaces or special characters, except underscores. Starting 
        with version 1.7, the OGR Shapefile driver tries to generate unique
        field names. Successive duplicate field names, including those 
        created by truncation to 10 characters, will be truncated to 8 
        characters and appended with a serial number from 1 to 99.
      </p>
      <p><strong>See Also:</strong>
        <a href="http://www.gdal.org/ogr/drv_shapefile.html" 
        target="_top">http://www.gdal.org/ogr/drv_shapefile.html</a>
      </p>
</div></td></tr></table>
</div>
<a name="WriteRecord"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">WriteRecord</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">extent</span>,
        <span class="sig-arg">attributes</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.WriteRecord">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Write record</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>extent</code></strong> (<code>list</code>) - [[ulx,uly],[urx,ury],[lrx,lry],[llx,lly]]</li>
        <li><strong class="pname"><code>attributes</code></strong> (<code>dict</code>) - Must match field names passed to __init__()</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="UpdateRecord"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">UpdateRecord</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">extent</span>,
        <span class="sig-arg">attributes</span>,
        <span class="sig-arg">where_clause</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.UpdateRecord">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Update record/s</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>where_clause</code></strong> (<code>str</code>) - Shapefile supported SQL where clause</li>
        <li><strong class="pname"><code>attributes</code></strong> (<code>dict</code>) - Must match field names passed to __init__()</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="DeleteRecord"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">DeleteRecord</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">where_clause</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="geometry-pysrc.html#ShapeWriter.DeleteRecord">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Delete record/s</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>where_clause</code></strong> (<code>str</code>) - Shapefile supported SQL where clause</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >MetaGETA (Metadata Gathering, Extraction and Transformation)</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    &nbsp;
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
